{namespace codepage}

/**
 * This is a Closure Template.  Build with:
 * java -jar ../_soy/SoyToJsSrcCompiler.jar --outputPathFormat template.js --srcs template.soy
 */

/**
 * Web page structure.
 */
{template .start}
  <table width="100%" height="100%">
    <tr>
      <td>
        <h1><a href="http://blockly.googlecode.com/">Blockly</a> &gt;{sp}
            <a href="../index.html">Apps</a> &gt; {$ij.MSG.title}</h1>
      </td>
    </tr>
    <tr>
      <td>
        <table>
          <tr id="tabRow" height="1em">
            <td id="tab_blocks" class="tabon" onclick="tabClick(this.id)">{$ij.MSG.blocks}</td>
            <td class="tabmin">&nbsp;</td>
            <td id="tab_javascript" class="taboff" onclick="tabClick(this.id)">JavaScript</td>
            <td class="tabmin">&nbsp;</td>
            <td id="tab_python" class="taboff" onclick="tabClick(this.id)">Python</td>
            <td class="tabmin">&nbsp;</td>
            <td id="tab_xml" class="taboff" onclick="tabClick(this.id)">XML</td>
            <td class="tabmax">
              <button title="{$ij.MSG.trashTooltip}" onclick="discard(); renderContent();">
                <img src='../../media/1x1.gif' class="trash">
              </button>{sp}
              <button id="linkButton" title="{$ij.MSG.linkTooltip}" onclick="BlocklyStorage.link()">
                <img src='../../media/1x1.gif' class="link">
              </button>{sp}
              <button title="{$ij.MSG.runTooltip}" class="launch" onclick="runJS()">
                <img src='../../media/1x1.gif' class="run">
              </button>
            </td>
          </tr>
        </table>
      </td>
    </tr>
    <tr>
      <td height="99%">
        {call .toolbox /}
        <iframe id="content_blocks" src="frame.html?{$ij.frameSrc}"></iframe>
        <pre id="content_javascript"></pre>
        <pre id="content_python"></pre>
        <div id="content_xml">
          <textarea id="textarea_xml"></textarea>
        </div>
      </td>
    </tr>
  </table>
{/template}

/**
 * Toolbox.
 */
{template .toolbox}
  <xml id="toolbox" style="display: none">
    <category name="{$ij.MSG.catControl}">
      <block type="controls_if"></block>
      <block type="controls_repeat"></block>
      <block type="controls_whileUntil"></block>
      <block type="controls_for">
        <value name="FROM">
          <block type="math_number">
            <title name="NUM">1</title>
          </block>
        </value>
        <value name="TO">
          <block type="math_number">
            <title name="NUM">10</title>
          </block>
        </value>
      </block>
      <block type="controls_forEach"></block>
      <block type="controls_flow_statements"></block>
    </category>
    <category name="{$ij.MSG.catLogic}">
      <block type="logic_compare"></block>
      <block type="logic_operation"></block>
      <block type="logic_negate"></block>
      <block type="logic_boolean"></block>
      <block type="logic_null"></block>
      <block type="logic_ternary"></block>
    </category>
    <category name="{$ij.MSG.catMath}">
      <block type="math_number"></block>
      <block type="math_arithmetic"></block>
      <block type="math_single"></block>
      <block type="math_trig"></block>
      <block type="math_constant"></block>
      <block type="math_number_property"></block>
      <block type="math_change">
        <value name="DELTA">
          <block type="math_number">
            <title name="NUM">1</title>
          </block>
        </value>
      </block>
      <block type="math_round"></block>
      <block type="math_on_list"></block>
      <block type="math_modulo"></block>
      <block type="math_constrain">
        <value name="LOW">
          <block type="math_number">
            <title name="NUM">1</title>
          </block>
        </value>
        <value name="HIGH">
          <block type="math_number">
            <title name="NUM">100</title>
          </block>
        </value>
      </block>
      <block type="math_random_int">
        <value name="FROM">
          <block type="math_number">
            <title name="NUM">1</title>
          </block>
        </value>
        <value name="TO">
          <block type="math_number">
            <title name="NUM">100</title>
          </block>
        </value>
      </block>
      <block type="math_random_float"></block>
    </category>
    <category name="{$ij.MSG.catText}">
      <block type="text"></block>
      <block type="text_join"></block>
      <block type="text_append">
        <value name="TEXT">
          <block type="text"></block>
        </value>
      </block>
      <block type="text_length"></block>
      <block type="text_isEmpty"></block>
      <block type="text_indexOf">
        <value name="VALUE">
          <block type="variables_get">
            <title name="VAR">text</title>
          </block>
        </value>
      </block>
      <block type="text_charAt">
        <value name="VALUE">
          <block type="variables_get">
            <title name="VAR">text</title>
          </block>
        </value>
      </block>
      <block type="text_getSubstring">
        <value name="STRING">
          <block type="variables_get">
            <title name="VAR">text</title>
          </block>
        </value>
      </block>
      <block type="text_changeCase"></block>
      <block type="text_trim"></block>
      <block type="text_print"></block>
      <block type="text_prompt"></block>
    </category>
    <category name="{$ij.MSG.catLists}">
      <block type="lists_create_empty"></block>
      <block type="lists_create_with"></block>
      <block type="lists_repeat">
        <value name="NUM">
          <block type="math_number">
            <title name="NUM">5</title>
          </block>
        </value>
      </block>
      <block type="lists_length"></block>
      <block type="lists_isEmpty"></block>
      <block type="lists_indexOf">
        <value name="VALUE">
          <block type="variables_get">
            <title name="VAR">list</title>
          </block>
        </value>
      </block>
      <block type="lists_getIndex">
        <value name="VALUE">
          <block type="variables_get">
            <title name="VAR">list</title>
          </block>
        </value>
      </block>
      <block type="lists_setIndex">
        <value name="LIST">
          <block type="variables_get">
            <title name="VAR">list</title>
          </block>
        </value>
      </block>
      <block type="lists_getSublist">
        <value name="LIST">
          <block type="variables_get">
            <title name="VAR">list</title>
          </block>
        </value>
      </block>
    </category>
    <category name="{$ij.MSG.catColour}">
      <block type="colour_picker"></block>
      <block type="colour_rgb"></block>
      <block type="colour_blend"></block>
    </category>
    <category name="{$ij.MSG.catVariables}" custom="VARIABLE">
	<block type="variables_new"></block>
	</category>
    <category name="{$ij.MSG.catProcedures}" custom="PROCEDURE"></category>
  </xml>
{/template}
